<script setup>
import { ref } from 'vue';
const { config } = defineProps({
  config: {
    type: Object,
    required: true,
  }
});
const emits = defineEmits(['change']);

const data = ref(config.value || '');

const handleChange = (value) => {
  emits('change', value);
}
</script>

<template>
  <el-input
    style="border:none"
    v-model="data"
    :type="config.type"
    :rows="config.rows || 2"
    :placeholder="`请输入${ config.label } ${ config.required ? '（必填）' : '（选填）' }`"
    @input="handleChange"
  />
</template>

<style lang="scss" scoped>
:deep(.el-textarea__inner){
  box-shadow: none;
  background-color: #F7F7F7;
  border-radius: 4px;
}
</style>